﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    public class DictionaryDemo2
    {
        public static void Main()
        {
            Dictionary<string, double> dics = new Dictionary<string, double>();

            
            dics.Add("anrun", 85.34);
            dics.Add("kamal", 75.50);
            dics.Add("Barun", 68.53);
            foreach (var dic in dics)
            {
                if (dic.Key.Equals("Barun"))
                    Console.WriteLine("Value is " + dic.Value);
                //Console.WriteLine("Key is " + dic.Key);
                //Console.WriteLine("Value is " + dic.Value);
            }

            Console.Write("Enter Name ");
            var name = Console.ReadLine();
            var dc = dics.Where(d => d.Key.ToLower().Equals(name.ToLower())).FirstOrDefault();
            Console.WriteLine("Value is " + dc.Value);
            Console.Read();
        }
    }
}
